package ru.rchervot.sanasar.client.view;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Label;

public class MessagesViewDefault extends Composite implements MessagesPresenter.Display {
	HorizontalPanel contentPanel = new HorizontalPanel();
	HorizontalPanel basePanel = new HorizontalPanel();
	Label text = new Label("DefaultMessagesView.");
	Hyperlink undo = new Hyperlink("Undo", "");
	
	private MessagesPresenter presenter;
	
	public MessagesViewDefault() {
		
		contentPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		contentPanel.setStylePrimaryName("DefaultMessagesView_Content");
		contentPanel.add(text);
		contentPanel.add(undo);
		
		DecoratorPanel decPanel = new DecoratorPanel();
		
		decPanel.add(contentPanel);
		decPanel.setVisible(false);
		
		basePanel.setSize("100%", Constants.kMessagesHeight + "px");
		basePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
		basePanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		basePanel.add(decPanel);
				
		this.initWidget(basePanel);

	}

	@Override
	public void setPresenter(MessagesPresenter presenter) {
		this.presenter = presenter;
	}
}
